import request from '@/utils/request'

// 获取快递员列表
export function getBusinessHall(params) {
  return request({
    url: '/manager/business-hall/courier/page',
    method: 'get',
    params
  })
}

// 获取司机列表
export function getDriver(params) {
  return request({
    url: '/manager/driver/page',
    method: 'get',
    params
  })
}

// 获取司机详情
export function getParticulars(id) {
  return request({
    url: `/manager/driver/${id}`
    // url: `/manager/driver/3090815455846087087`

  })
}

// 保存司机信息
export function putParticulars(data) {
  return request({
    url: `/manager/driver/${data.id}`,
    method: 'put',
    data
  })
}

// 获取驾驶证信息
export function getDriverLicense(id) {
  return request({
    url: `/manager/driverLicense/${id}`
  })
}

// 保存驾驶证信息
export function putDriverLicense(data) {
  return request({
    url: `/manager/driverLicense`,
    method: 'put',
    data
  })
}

// 保存驾驶证信息
export function postDriverLicense(data) {
  return request({
    url: `/manager/driverLicense`,
    method: 'post',
    data
  })
}

// 保存驾驶证信息
export function postImageUpload(file) {
  return request({
    url: `/manager/files/imageUpload`,
    method: 'post',
    data: {
      file: file
    }
  })
}

// 查询排班列表
export function workSchedulings(params) {
  return request({
    url: `/manager/work-schedulings`,
    method: 'get',
    params
  })
}

// 查询工作模式详情
export function workPatterns(id) {
  return request({
    url: `/manager/work-patterns/${id}`
  })
}

// 查询分页工作模式
export function getWorkPatterns(params) {
  return request({
    url: `/manager/work-patterns/page`,
    params
  })
}

// 获取停用车辆
export function unWorkingTrucks() {
  return request({
    url: `/manager/unWorkingTrucks`
  })
}

// 获取车辆详情
export function getTrucks(id) {
  return request({
    url: `/manager/truck/${id}`
  })
}

// 车辆绑定司机
export function postTruckDrivers(data) {
  return request({
    url: `/manager/truck/truckDrivers`,
    method: 'post',
    data

  })
}

// 新增工作模式
export function postWorkPatterns(data) {
  return request({
    url: `/manager/work-patterns`,
    method: 'post',
    data

  })
}

// 列表获取工作模式详情
export function workPatternsAll() {
  return request({
    url: `/manager/work-patterns/all`

  })
}

// 批量关联排班
export function bathWorkPatterns(data) {
  return request({
    url: `/manager/work-schedulings`,
    method: 'post',
    data
  })
}

export function delWorkSchedulings(id, operator) {
  return request({
    url: `/manager/work-schedulings/${id}/${operator}`,
    method: 'DELETE'
  })
}

